package com.xframe.xdal.core.constant;
/**
 * 功能描述：运行时机
 * 创建人：xf
 * 创建时间：2022/10/9
 *
 * @version 1.0
 **/
public enum RunOpportunity {


    /**
     * insert
     */
    C,
    /**
     * 查询
     */
    R,
    /**
     * 修改
     */
    U,
    ;

    RunOpportunity(){
        this.mask = 1 << ordinal();
    }

    private int mask;

    public int getMask(){
        return this.mask;
    }

    public static boolean exists(int maskVal,RunOpportunity runOpportunity){
        return (maskVal & runOpportunity.getMask()) != 0;
    }

}
